package com.kcwl.carrier.domain.factory;


import com.kcwl.carrier.domain.entity.CarrierCompanyInfo;
import com.kcwl.carrier.interfaces.command.CarrierApproveCommand;
import com.kcwl.framework.utils.KcBeanConverter;

/**
 * @author 刘旭超
 * @date 2022年07月13日 16:38
 * @Description
 */
public class CarrierCompanyInfoFactory {

    /**
     * 创建物流公司认证信息对象
     */
    public static CarrierCompanyInfo createCarrierCompanyApproveInfo(CarrierApproveCommand carrierApproveCommand) {
        CarrierCompanyInfo carrierCompanyInfo = KcBeanConverter.toBean(carrierApproveCommand, CarrierCompanyInfo.class);
        carrierCompanyInfo.setCarrierId(carrierApproveCommand.getUserId());
        carrierCompanyInfo.setBankCardName(carrierApproveCommand.getEnterpriseName());
        carrierCompanyInfo.setIncorporationDate(carrierApproveCommand.getEstablishedDate());
        return carrierCompanyInfo;
    }
}
